From 50e1d7fdf0c107639f6fb8ea07f164bfe90d4700 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 5 May 2008 22:21:01 +0000 Subject: [PATCH] Revert r34199, r34205 for now. I don't really like the var name $wgSharedDBtables (inconsistent caps). Compare with Gregory's patch on bug 2396: https://bugzilla.wikimedia.org/show_bug.cgi?id=2396 https://bugzilla.wikimedia.org/attachment.cgi?id=3610 That uses a var named $wgSharedTables, but makes it more flexible (allowing arbitrary DB and prefix per table), which may or may not be a super idea. --- includes/Database.php | 6 ++---- includes/DefaultSettings.php | 19 ++++--------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/includes/Database.php b/includes/Database.php index 2b20d98e72..1f19226e32 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -1365,15 +1365,13 @@ class Database { * @param string $name database table name */ function tableName( $name ) { - global $wgSharedDB, $wgSharedDBtables; + global $wgSharedDB; # Skip quoted literals if ( $name{0} != '`' ) { if ( $this->mTablePrefix !== '' && strpos( $name, '.' ) === false ) { $name = "{$this->mTablePrefix}$name"; } - if ( isset( $wgSharedDB ) && isset( $wgSharedDBtables ) - && substr( $name, 0, strlen($this->mTablePrefix) ) == $this->mTablePrefix - && in_array( substr( $name, strlen($this->mTablePrefix) ), $wgSharedDBtables ) ) { + if ( isset( $wgSharedDB ) && "{$this->mTablePrefix}user" == $name ) { $name = "`$wgSharedDB`.`$name`"; } else { # Standard quoting diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 7c2709011c..9b2928a9c0 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -577,25 +577,14 @@ $wgAllDBsAreLocalhost = false; /** Live high performance sites should disable this - some checks acquire giant mysql locks */ $wgCheckDBSchema = true; -/** - * Shared database for multiple wikis. - * The server for this database must be the same as for the main database. - * EXPERIMENTAL - */ -$wgSharedDB = null; /** - * List of database tables (without prefixes) to share when $wgSharedDB is enabled. - * This only includes the user table by default for backwards compatibility. - * However you may remove it so that you can enable extensions using the shared - * DB without having shared users. Or you can add in another table, such as - * interwiki to force MediaWiki to use the shared version of the table instead. - * - * Be carefull with sharing tables. The images, revisions, pages, and many of - * the other tables may have bad side effects if you share them. + * Shared database for multiple wikis. Presently used for storing a user table + * for single sign-on. The server for this database must be the same as for the + * main database. * EXPERIMENTAL */ -$wgSharedDBtables = array( 'user' ); +$wgSharedDB = null; /** * Database load balancer -- 2.20.1